/**
 * 
 */
package property;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

/**
 * @author Nugumanova V.
 * 
 */
public class UserProperty {
	private Properties properties = new Properties();

	/*
	 * public UserProperty (){ properties = new Properties(); }
	 */
	public void propertyRead(String filePath) throws IOException {

		FileInputStream in = new FileInputStream(filePath);
		try {
			properties.load(in);
		} catch (IOException e) {
			System.out.println("Failed to load properties!");
		} finally {
			in.close();
		}

	}

	public Map<String, String> getProperties() {
		Map<String, String> SweetMap = new HashMap<String, String>();
		for (String key : properties.stringPropertyNames()) {
			SweetMap.put(key, properties.getProperty(key));
		}
		return SweetMap;
	}
}
